<!DOCTYPE html>
<html  lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
    <title>登录后台管理系统</title>
    <meta name="description" content="后台管理框架">
    <link href="../static/css/bootstrap.min.css" th:href="@{/css/bootstrap.min.css}" rel="stylesheet"/>
    <link href="../static/css/font-awesome.min.css" th:href="@{/css/font-awesome.min.css}" rel="stylesheet"/>
    <link href="../static/css/style.css" th:href="@{/css/style.css}" rel="stylesheet"/>
    <link href="../static/css/login.css" th:href="@{/css/login.css}" rel="stylesheet"/>
    <link href="../static/doseng/css/doseng-ui.css" th:href="@{/doseng/css/doseng-ui.css?v=4.2.0}" rel="stylesheet"/>
    <!-- 360浏览器急速模式 -->
    <meta name="renderer" content="webkit">
    <!-- 避免IE使用兼容模式 -->
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <link rel="shortcut icon" href="../static/doseng.ico" th:href="@{/doseng.ico}"/>
    <style type="text/css">label.error { position:inherit;  }</style>
    <script>
        // (function(){
        //     window.alert = function(name){
        //         var iframe = document.createElement("IFRAME");
        //         iframe.style.display="none";
        //         iframe.setAttribute("src", 'data:text/plain');
        //         document.documentElement.appendChild(iframe);
        //         window.frames[0].window.alert(name);
        //         iframe.parentNode.removeChild(iframe);
        //     }
        // })();
        if(window.top!==window.self){
            alert('未登录或登录超时,请重新登录.');
            top.location.reload();
        };
    </script>
</head>
<body class="signin">
    <div class="signinpanel">
        <div class="row">
            <div class="col-sm-6 col-sm-offset-6">
                <form id="signupForm" autocomplete="off">
                    <h1 class="no-margins">重置密码</h1>
                    <input type="password" name="password" class="form-control uname"  placeholder="请输入密码" value="" />
                    <button type="button" class="btn btn-success btn-block" th:onclick="pswmodify()" >提交</button>
                </form>
            </div>
        </div>
        <div class="signup-footer">
            <div class="pull-right">
                &copy; 2020 All Rights Reserved. <br>
            </div>
        </div>
    </div>
<script th:inline="javascript"> var ctx = [[@{/}]]; var captchaType = [[${captchaType}]]; var portalCode = [[${portalCode}]];var mail = [[${mail}]]</script>
<!-- 全局js -->
<script src="../static/js/jquery.min.js" th:src="@{/js/jquery.min.js}"></script>
<script src="../static/js/bootstrap.min.js" th:src="@{/js/bootstrap.min.js}"></script>
<!-- 验证插件 -->
<script src="../static/ajax/libs/validate/jquery.validate.min.js" th:src="@{/ajax/libs/validate/jquery.validate.min.js}"></script>
<script src="../static/ajax/libs/validate/messages_zh.min.js" th:src="@{/ajax/libs/validate/messages_zh.min.js}"></script>
<script src="../static/ajax/libs/layer/layer.min.js" th:src="@{/ajax/libs/layer/layer.min.js}"></script>
<script src="../static/ajax/libs/blockUI/jquery.blockUI.js" th:src="@{/ajax/libs/blockUI/jquery.blockUI.js}"></script>
<script src="../static/doseng/js/doseng-ui.js" th:src="@{/doseng/js/doseng-ui.js?v=4.2.0}"></script>
<script>
    var reg = new RegExp("^[a-z0-9]+([._\\-]*[a-z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$"); //正则表达式
    function pswmodify() {
        $.modal.loading("正在提交");
        var password = $.common.trim($("input[name='password']").val());
        $.ajax({
            type: "post",
            url: ctx +"hotel/forgotpsw/"+ portalCode+ "/pswmodify",
            data: {mail:mail,password:password},
            success: function(r) {
                $.modal.closeLoading();
                if (r.code == 0) {
                    $.modal.msg(r.msg);
                    setTimeout("returnLogin()",1000);
                } else {
                    $.modal.msg(r.msg);
                }
            }
        });
    };
    function returnLogin() {
        location.href = ctx + portalCode + '/login';
    }
</script>
</body>
</html>
